import Vue from 'vue'
import VueRouter from 'vue-router'

const Home = () => import('views/Home/Home')
const Category = () => import('views/category/category')
const Cart = () => import('views/cart/cart')
const Profile = () => import('views/profile/profile')
const Detail = () => import("views/detail/Detail")

// 1.安装插件
Vue.use(VueRouter)

// 2.创建router
const routes = [
    {
      path: '',
      redirect: '/Home'
    },
    {
      path: '/Home',
      component: Home
    },
    {
      path: '/Category',
      component: Category
    },
    {
      path: '/Cart',
      component: Cart
    },
    {
      path: '/Profile',
      component: Profile
    },
    {
      path: '/Detail/:ID',
      component: Detail
    }
]
const router = new VueRouter({
  routes
})

export default router
